package com.lifeng.fallback;

import com.lifeng.bean.User;
import com.lifeng.client.UserServiceFeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * Created by lifeng on 2018/4/27.
 */
@Component
public class UserServiceFallBack implements UserServiceFeignClient{
    @Override
    public User findById(@PathVariable("id") String id) {
        System.out.println("findById fast fall back");
        return new User();
    }

    @Override
    public User save(@RequestParam("id") String id, @RequestParam("name") String name) {
        System.out.println("save fast fall back");
        return new User();
    }

    @Override
    public User save1(@RequestParam Map<String, Object> param) {
        System.out.println("save1 fast fall back");
        return new User();
    }
}
